import { LOGIN_DOMAIN, LOGIN_ACCESS_ORIGIN } from '@/settings'

const POST = 'POST'
const GET = 'GET'

/**
 * @description 重塑http写法
 * @param {}} data
 * @returns
 */
export const user = {
  /**
   * @description 获取登录方式
   */
  getLoginType: ['/local/auth/auth/config', GET],

  // 目前登录接口
  login: ['/local/auth/auth/login', POST],
  logoutUrl: [
    `/${LOGIN_DOMAIN}/api/v1/authorization/oidc/logout?access-origin=${LOGIN_ACCESS_ORIGIN}`,
    POST,
    'api'
  ],

  /**
   * @description 是否需要修改密码
   */
  willUpdatePassword: ['/admin/regulation/checklogin', GET],
  /**
   * @description 根据用户获取密码规则
   */
  getPswRuleByUsr: ['/admin/regulation/findoneabridge', GET],

  /**
   * @description 修改用户密码
   */
  forceModifyPsw: ['/admin/user/updatepassword', POST],

  /**
   * @description
   * swagger see url ....
   */
  getInfo: ['/local/admin/user/info', GET],

  /**
   * @description 获取用户菜单
   */
  getMenu: ['/local/admin/menu', GET],
  /**
   * @description 添加用户
   */
  addUser: ['/admin/user/add', POST],

  /**
   * @description 用户更新
   */
  updateUser: ['/admin/user/update', POST],
  /**
   * @description 获取用户列表
   */
  getUserList: ['/admin/user/page', GET],

  /**
   * @description 获取用户列表
   */
  getPwdPolicyOptions: ['/admin/regulation/findabridge', GET],

  /**
   * @description 获取秘钥
   */
  getPublicKey: ['/admin/security/key', POST],

  /**
   * @description 校验密码
   */
  checkPassword: ['/admin/regulation/checkpassword', POST],

  /**
   * @description 删除用户信息
   */
  deleteUser: ['/admin/user/del', POST],

  /**
   * @description 发送短信验证码
   */
  // sendMsgVerificationCode: ['/uep-system/user/msg/verification', GET],
  /**
   * @description 获取图形验证码
   */
  getImgVerificationCodeV1: [
    '/platformapi/auth/captcha/getArithmeticCode',
    GET
  ],

  /**
   * @description 获取图形验证码
   */
  getImgVerificationCode: ['/platformapi/auth/sso/getArithmeticCode', GET],

  /**
   * @description 发送验证码
   */
  sendMsgVerify: ['/platformapi/auth/auth/verify/code', POST],
  /**
   * @description 获取用户基本信息
   */
  getAcountSelf: ['/data-security/api/v1/self/user/info', GET]
}
